/**
 * Created by Administrator on 2017/3/30.
 */
/**
 * Created by Administrator on 2017/3/22 0022.
 */
import Relay from "react-relay";

export default class GetChildOrdersMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getChildOrders }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId: this.props.orderId,
                type: this.props.type
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getChildOrdersPayload {
            getChildOrders {
                errorCode
                value
                totalResult
                id
                orders{
                    oid
                    orderGoodsNum
                    partAName
                    orderType
                    account
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on getChildOrdersPayload {
                    getChildOrders {
                        errorCode
                        value
                        totalResult
                        id
                        orders{
                            oid
                            orderGoodsNum
                            partAName
                            orderType
                            account
                        }
                    }
                }
            `]
        }];
    }

}